<extend name="Common@Base/layout"/>
<block name="body">
    <form id="task_form" name="task_form" method="post" action="/evaluating/index/publish">
        <div class="main-content main-pagebar-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <h3 class="mod-title">
                            <span class="t">
                                {$user_task['title']}
                                </span>
                        </h3>
                        <input name="user_task_id" type="hidden" value="{$user_task.id}"/>
                        <div class="panel panel-default">
                            <div class="table-responsive">
                                <table class="table-check table-link-hover table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th class="text-center" style="width:10px">序号</th>
                                        <th>指标名称</th>
                                        <th>测评内容</th>
                                        <th>测评标准</th>
                                        <th class="text-center" style="width:6%">状态</th>
                                        <th class="text-right" style="width:6%"></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <volist name="user_task_quota_list" id="task">
                                        <tr data-vstatus="{$task.status}">
                                            <td class="text-center">{$i}</td>
                                            <td>
                                                {$task.name}
                                            </td>
                                            <td>
                                                {$task.quota_content}
                                            </td>
                                            <td>
                                                <div class="truncate-b" title="{$task.standard}">
                                                    {$task.standard}
                                                </div>
                                            </td>

                                            <if condition="$task.status eq 1">
                                                <td class="text-center">
                                                    已填
                                                </td>
                                                <else/>
                                                <td class="text-center" style="color: red">
                                                    未填
                                                </td>
                                            </if>

                                            <td class="td-action">
                                                <if condition="$user_task.status lt 2">
                                                    <a class="td-btn" href="/evaluating/index/edit?id={$task.id}" role="button">编辑</a>
                                                    <else/>
                                                    <a class="td-btn" href="/evaluating/index/edit?id={$task.id}" role="button">查看</a>
                                                </if>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="main-pagebar">
            <if condition="$user_task.status lt 2">
                <button type="button" style="margin-right:10px" class="btn btn-primary" action-type="publish">上报测评信息</button>
            </if>
            <button type="button" style="margin-right:30px" class="btn btn-default"  onclick="location.href='/evaluating/index/index';">返 回</button>
        </div>

    </form>

    <script>
        $(document).ready(function () {
            $('#nav-evaluating').addClass("active");
            var vx = $("#search_status").val();
            if (vx != "") {
                $("#search_status").prev().find('a').each(function () {
                    var $this = $(this);
                    if ($this.data('value') == vx) {
                        $("#search_status_name").text($this.text());
                    }
                });
            }

            $('button[action-type="publish"]').click(function () {
                var $tr = $(this).parent().parent();
                alertify.confirm("确定上报？", function (e) {
                    $("#task_form").submit();
                });
            });
        });
    </script>
</block>